class Solution(object):
    def isArmstrong(self, n):
        """
        :type n: int
        :rtype: bool
        """
        m = n
        value = 0
        now = []
        while n // 10 > 0:
            now.append(n % 10)
            n = n // 10
        now.append(n)
        b = len(now)
        for item in now:
            value += item ** b
        return value == m


data = Solution()
n = 123
print(data.isArmstrong(n))
